import axios from "../utils/request";

//我的课程列表
export interface catgetCourseListData {
  page: number;
  limit: string;
  sid: string;
}
export function catgetCourseList(params: catgetCourseListData) {
  return axios.post("/api/cat/getCourseList", params);
}
//知识点
export interface catZsdData {
  id: string;
}
export function postcatZsd(params: catZsdData) {
  return axios.post("/api/cat/Zsd", params);
}
// 课程中心
export interface catgetVideoListData {
  gid: string; //年级id
  sid: string; //学科id
  type: string; //类型
  kid: string; //知识点
}
export function catgetVideoList(params: catgetVideoListData) {
  return axios.post("/api/cat/getVideoList", params);
}
// 课程学习
export interface catstudyCourseData {
  page: string; //分页
  limit: string; //分页条数
  vid: string; //课程id
}
export function catstudyCourse(params: catstudyCourseData) {
  return axios.post("/api/cat/studyCourse", params);
}
// 播放时长
export interface catsaveRecordDetailData {
  kid: number; //分页
  mid: number; //分页条数
  rid: number; //课程id
  times: number;
  cTime: number;
}
export function catsaveRecordDetail(params: catsaveRecordDetailData) {
  return axios.post("/api/cat/saveRecordDetail", params);
}
// 视频播放完成 记录知识点
export interface catsaveVodeoFinishedData {
  kid: number; //知识//点
  gid: number; //年级
  sid: number; //学科
  vid:number
}
export function catsaveVodeoFinished(params: catsaveVodeoFinishedData) {
  return axios.post("/api/cat/saveVodeoFinished", params);
}
// 我的播放（视频列表）
export interface catgetVideoLimitData {
  cid: number; //vid
  page: number; //分页条数
  limit: number; //课程id
}
export function catgetVideoLimit(params: catgetVideoLimitData) {
  return axios.post("/api/cat/getVideoLimit", params);
}

export function getUserSubject() {
  return axios.get("api/cat/getUserSubject", );
}
